"""
Smart Review Models
"""

from typing import Optional
from pydantic import BaseModel, Field
from datetime import datetime


class ReviewRequest(BaseModel):
    """Review request"""
    user_id: str = Field(..., min_length=1, max_length=50, description="User ID")
    question: str = Field(..., min_length=1, description="Question")
    grading_criteria: Optional[str] = Field(default=None, description="Grading criteria")
    student_answer: Optional[str] = Field(default=None, description="Student answer text")
    student_answer_file: Optional[str] = Field(default=None, description="Student answer file (base64)")
    document_name: Optional[str] = Field(default="student_answer.txt", description="Document name")


class ReviewFeedback(BaseModel):
    """Review feedback"""
    overall_grade: Optional[float] = None
    strengths: Optional[str] = None
    weaknesses: Optional[str] = None
    suggestions: Optional[str] = None
    detailed_feedback: str


class ReviewResult(BaseModel):
    """Review result"""
    review_id: str
    session_id: str
    user_id: str
    document_name: str
    feedback: ReviewFeedback
    reviewed_at: datetime
    processing_time: Optional[float] = None


class ReviewResponse(BaseModel):
    """Review response"""
    success: bool
    message: str
    result: Optional[ReviewResult] = None
    error: Optional[str] = None
